#include "TcpServer.hpp"
#include <memory>

void Usage(std::string s)
{
    std::cout << "\n\rUsage: " << s << " port[1024+]\n"
              << std::endl;
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }

    uint16_t port = std::stoi(argv[1]);
    lg.changeMethod(Classfile);
    std::unique_ptr<TcpServer> tcp_svr(new TcpServer(defaultip, port));
    tcp_svr->Init();
    std::cout << "服务器初始化成功" << std::endl;
    tcp_svr->Run();
    return 0;
}